<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>File Source for sample.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
											</head>
		<body>
						<h1>Source for file sample.php</h1>
<p>Documentation is available at <a href="../EPass/_libsPub---Epass---sample.php.html">sample.php</a></p>
<div class="src-code">
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php&nbsp;</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;EPass</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;Oliver&nbsp;Leisalu</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a6"></a><a href="http://www.php.net/session_start">session_start</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a7"></a>require<span class="src-sym">(</span><span class="src-str">'Epass.class.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a8"></a>require<span class="src-sym">(</span><span class="src-str">'EpassResponse.class.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a9"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-comm">//&nbsp;direct&nbsp;user&nbsp;to&nbsp;epass</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$_POST</span><span class="src-sym">[</span><span class="src-str">'login'</span><span class="src-sym">]&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a12"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a13"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../EPass/Epass.html">Epass</a></span><span class="src-sym">::</span><a href="../EPass/Epass.html#methodsendToEpass">sendToEpass</a><span class="src-sym">(&nbsp;</span><span class="src-str">'sample-conf.php'&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a14"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-comm">//&nbsp;handle&nbsp;replay</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$_POST&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a17"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a18"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$response&nbsp;</span>=&nbsp;<span class="src-id"><a href="../EPass/Epass.html">Epass</a></span><span class="src-sym">::</span><a href="../EPass/Epass.html#methodhandleReplay">handleReplay</a><span class="src-sym">(&nbsp;</span><span class="src-str">'sample-conf.php'&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a19"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a20"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$response</span><span class="src-sym">-&gt;</span><span class="src-id">isSuccessful&nbsp;</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a21"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<span class="src-str">'&lt;h3&gt;Username:&nbsp;'</span>.<span class="src-var">$response</span><span class="src-sym">-&gt;</span><span class="src-id">username</span>.<span class="src-str">',&nbsp;fullname:&nbsp;'</span>.<span class="src-var">$response</span><span class="src-sym">-&gt;</span><span class="src-id">name</span>.<span class="src-str">'&lt;/h3&gt;&lt;br&nbsp;/&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a22"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a23"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<span class="src-str">'&lt;h3&gt;Login&nbsp;failed!&nbsp;(error&nbsp;code:&nbsp;'</span>.<span class="src-var">$response</span><span class="src-sym">-&gt;</span><span class="src-id">errorCode</span>.<span class="src-str">')&lt;/h3&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a24"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-php">?&gt;</span></div></li>
<li><div class="src-line"><a name="a26"></a>&lt;form&nbsp;name=&quot;form&quot;&nbsp;action=&quot;&quot;&nbsp;method=&quot;post&quot;&gt;</div></li>
<li><div class="src-line"><a name="a27"></a>&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type=&quot;submit&quot;&nbsp;name=&quot;login&quot;&nbsp;value=&quot;Login&quot;&gt;</div></li>
<li><div class="src-line"><a name="a28"></a>&lt;/form&gt;</div></li>
</ol></div>
</div>
	<p class="notes" id="credit">
		Documentation generated on Fri, 24 Sep 2010 21:15:11 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</body>
</html>